     .ORIG x3000
;store 1 at addr 0x4000  
;     LEA R0, U
;     LDW R1, R0, #0
;     LDW R2, R1, #0
;     ADD R2, R2, #1
;     STW R2, R1, #0
;store the sum of 20 bytes
;from xC000 into xC014
     LEA R0, Y
     LDW R1, R0, #0
     AND R2, R2, #0
     LEA R3, T
     LDW R3, R3, #0
loop LDB R2, R1, #0
     ADD R4, R4, R2
     ADD R1, R1, #1
     ADD R3, R3, #-1
     BRp loop
;store the 20 bytes sum;
     LEA R0, Z
     LDW R1, R0, #0
     STW R4, R1, #0
;cause protection exception
     ;LEA R0, W
     ;LDW R1, R0, #0
     ;STW R4, R1, #0
;cause a unaligned exception
     LEA R0, V
     LDW R1, R0, #0
     LDW R3, R1, #0
     STW R2, R0, #0
;cause a illegal opcode ex
     .FILL xA000 
     ;HALT

T .FILL x0014
U .FILL x4000
V .FILL xC017
W .FILL x0000
Y .FILL xC000
Z .FILL xC014
  .END
